package com.ljy.springcloud.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

@RestController
public class PaymentController {
    private final String PAYMENT_URL = "http://consul-provider-payment";
    @Resource
    RestTemplate restTemplate;

    @GetMapping("/consumer/payment/consul")
    public String consul() {
        return restTemplate.getForObject(PAYMENT_URL + "/payment/consul", String.class);
    }
}
